#ifndef __Logger_hpp__
#define __Logger_hpp__

#include "Pointer.hpp"
#include "Singleton.hpp"

namespace ge {

GE_DECLARE_CLASS( Logger );
GE_DECLARE_CLASS( OutputStream );

//----------------------------------------------------------------------------//
// Logger
//----------------------------------------------------------------------------//

class Logger : public virtual ReferenceCounted, public Singleton< Logger >
{

 friend class FileSystem;

 public:

     static void Message( const char* _msg );

     static void FMessage( const char* _msg, ... );

     static void Info( const char* _msg );

     static void FInfo( const char* _msg, ... );

     static void Warning( const char* _msg );

     static void FWarning( const char* _msg, ... );

     static void Error( const char* _msg );

     static void FError( const char* _msg, ... );

     static void Exception( const ge::Exception& _e, const char* _msg = 0 );

     static void FException( const ge::Exception& _e, const char* _msg, ... );

 protected:

     Logger( void );

     virtual ~Logger( void );

     OutputStreamPtr m_log;
};

#define geLogMsg( _msg, ... ) ge::Logger::FMessage( _msg, __VA_ARGS__ )
#define geLogInfo( _msg, ... ) ge::Logger::FInfo( _msg, __VA_ARGS__ )
#define geLogWarning( _msg, ... ) ge::Logger::FWarning( _msg, __VA_ARGS__ )
#define geLogError( _msg, ... ) ge::Logger::FError( _msg, __VA_ARGS__ )
#define geLogException( _e, _msg, ... ) ge::Logger::FException( _e, _msg, __VA_ARGS__ )

} // namespace ge

#endif//__Logger_hpp__
